#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/11/19 14:57
# @Author  : huidong.bai
# @File    : execute_control.py
# @Software: PyCharm

import constant
from public.requests import midea_control_api
from public.requests import nano_control_api


def run(query, env_data):
    url = env_data.get('url')
    if url == constant.MIDEA_CONTROL_URL:
        print('aaaaaaaaaaaaaaaaaaaaa')
        return midea_control_api.execute(query=query, params=env_data)
    elif url == constant.NANO_CONTROL_URL:
        print('bbbbbbbbbbbbbbbbbbbb')
        return nano_control_api.execute(query=query, params=env_data)
    else:
        raise Exception('url反控接口获取失败！')
